using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Fields
{
    /// <summary>
    /// <para>Calculate End Time</para>
    /// <para>Calculates the end time of features based on the time values stored in another field.</para>
    /// <para>根据存储在另一个字段中的时间值计算要素的结束时间。</para>
    /// </summary>    
    [DisplayName("Calculate End Time")]
    public class CalculateEndTime : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CalculateEndTime()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_table">
        /// <para>Input Table</para>
        /// <para>The feature class or table for which an End Time Field is calculated based on the Start Time Field specified.</para>
        /// <para>根据指定的开始时间字段计算结束时间字段的要素类或表。</para>
        /// </param>
        /// <param name="_start_field">
        /// <para>Start Time Field</para>
        /// <para>The field containing values that will be used to calculate values for the End Time Field. The Start Time Field and the End Time Field must be of the same type. For example, if the Start Time Field is of type LONG, the End Time Field should be of type LONG as well.</para>
        /// <para>包含将用于计算“结束时间”字段值的值的字段。“开始时间”字段和“结束时间”字段必须属于同一类型。例如，如果“开始时间”字段的类型为 LONG，则“结束时间字段”的类型也应为 LONG。</para>
        /// </param>
        /// <param name="_end_field">
        /// <para>End Time Field</para>
        /// <para>The field that will be populated with values based on the Start Time Field specified. The Start Time Field and the End Time Field must be of the same format.</para>
        /// <para>将使用基于指定的“开始时间”字段的值填充的字段。“开始时间”字段和“结束时间”字段的格式必须相同。</para>
        /// </param>
        public CalculateEndTime(object _in_table, object _start_field, object _end_field)
        {
            this._in_table = _in_table;
            this._start_field = _start_field;
            this._end_field = _end_field;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Calculate End Time";

        public override string CallName => "management.CalculateEndTime";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_table, _start_field, _end_field, _fields, _out_table];

        /// <summary>
        /// <para>Input Table</para>
        /// <para>The feature class or table for which an End Time Field is calculated based on the Start Time Field specified.</para>
        /// <para>根据指定的开始时间字段计算结束时间字段的要素类或表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_table { get; set; }


        /// <summary>
        /// <para>Start Time Field</para>
        /// <para>The field containing values that will be used to calculate values for the End Time Field. The Start Time Field and the End Time Field must be of the same type. For example, if the Start Time Field is of type LONG, the End Time Field should be of type LONG as well.</para>
        /// <para>包含将用于计算“结束时间”字段值的值的字段。“开始时间”字段和“结束时间”字段必须属于同一类型。例如，如果“开始时间”字段的类型为 LONG，则“结束时间字段”的类型也应为 LONG。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Start Time Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _start_field { get; set; }


        /// <summary>
        /// <para>End Time Field</para>
        /// <para>The field that will be populated with values based on the Start Time Field specified. The Start Time Field and the End Time Field must be of the same format.</para>
        /// <para>将使用基于指定的“开始时间”字段的值填充的字段。“开始时间”字段和“结束时间”字段的格式必须相同。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("End Time Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _end_field { get; set; }


        /// <summary>
        /// <para>ID Fields</para>
        /// <para>The name of the field or fields that can be used to uniquely identify spatial entities. These fields are used to first sort based on entity type if there is more than one entity. For instance, for a feature class representing population values per state over time, the state name could be the unique value field (the entity). If population figures are per county, you would need to set the county name and state name as the unique value fields, since some county names are the same for different states. If there is only one entity, this parameter can be ignored.</para>
        /// <para>可用于唯一标识空间实体的一个或多个字段的名称。如果存在多个实体，则这些字段用于首先根据实体类型进行排序。例如，对于表示每个州随时间变化的人口值的要素类，州名称可以是唯一值字段（实体）。如果人口数字是按县计算的，则需要将县名称和州名称设置为唯一值字段，因为某些县名称对于不同的州是相同的。如果只有一个实体，则可以忽略此参数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("ID Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _fields { get; set; } = null;


        /// <summary>
        /// <para>Updated Input Table</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_table { get; set; }


        public CalculateEndTime SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}